/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package xml.converter;

import java.io.IOException;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.restlet.data.MediaType;
import org.restlet.representation.Representation;
import xml.jdom.JDOMRepresentation;

/**
 * Cette classe permet de convertir un element JDOM en une Representation
 * @author marya
 */
public class JDOMElementRepresentationConverter implements Converter<Element,Representation> {

    public JDOMElementRepresentationConverter() {
    }



    public Representation convert(Element item) throws IOException , JDOMException{
        return new JDOMRepresentation(MediaType.TEXT_XML, new Document(item));
    }



}
